package businessError

// 公共错误码
var (
	NotFound            = &ErrorInfo{Code: 404, Msg: "未找到记录"}
	SystemError         = &ErrorInfo{Code: 500, Msg: "系统错误"}
	DataBaseError       = &ErrorInfo{Code: 2000, Msg: "数据库错误"}
	ParamsInvalid       = &ErrorInfo{Code: 10000, Msg: "无效参数"}
	OperateError        = &ErrorInfo{Code: 10001, Msg: "操作失败"}
	OperateFieldError   = &ErrorInfo{Code: 10002, Msg: "操作字段不存在"}
	OperateValueError   = &ErrorInfo{Code: 10003, Msg: "操作字段值不合法"}
	MethodEmpty         = &ErrorInfo{Code: 10004, Msg: "method参数不能为空"}
	NoPermission        = &ErrorInfo{Code: 10005, Msg: "没有权限查看"}
	NoPermissionOperate = &ErrorInfo{Code: 10006, Msg: "没有权限操作"}
	ParamsInvalidF      = &ErrorInfo{Code: 10007, Msg: "参数无效(%s)"}
)

var (
	// auth错误码
	AuthTokenInvalid         = &ErrorInfo{Code: 20001, Msg: "登录状态失效"}
	AuthUserNotExits         = &ErrorInfo{Code: 20404, Msg: "用户不存在"}
	AuthAccountEmpty         = &ErrorInfo{Code: 20500, Msg: "账号不能为空"}
	AuthPasswordEmpty        = &ErrorInfo{Code: 20501, Msg: "密码不能为空"}
	AuthIdEmpty              = &ErrorInfo{Code: 20502, Msg: "ID不能为空"}
	AuthLoginFailureLock     = &ErrorInfo{Code: 20503, Msg: "账号或密码无效，错误次数超过%v次，请5分钟后再尝试！"}
	AuthLoginFailure         = &ErrorInfo{Code: 20504, Msg: "账号或密码无效，错误次数剩余%d次"}
	AuthLoginFail            = &ErrorInfo{Code: 20505, Msg: "登录失败"}
	AuthAccountPasswordError = &ErrorInfo{Code: 20506, Msg: "账号或密码无效"}
	AuthAdminForbidden       = &ErrorInfo{Code: 20507, Msg: "账号已禁用"}
	AuthDeniedPermission     = &ErrorInfo{Code: 20508, Msg: "没有权限操作"}

	// Admin错误码
	AdminEmailError              = &ErrorInfo{Code: 30000, Msg: "邮箱格式错误"}
	AdminNicknameError           = &ErrorInfo{Code: 30001, Msg: "昵称不能为空"}
	AdminUsernameError           = &ErrorInfo{Code: 30002, Msg: "账号只能以字母开头，长度为6-20"}
	AdminPasswordError           = &ErrorInfo{Code: 30003, Msg: "密码不能小于6位"}
	AdminRoleIdsEmpty            = &ErrorInfo{Code: 30004, Msg: "角色组不能为空"}
	AdminRoleIdsError            = &ErrorInfo{Code: 30004, Msg: "角色组参数不合法"}
	AdminStatusError             = &ErrorInfo{Code: 30005, Msg: "状态参数不合法"}
	AdminEmailExists             = &ErrorInfo{Code: 30006, Msg: "邮箱已存在"}
	AdminUsernameExists          = &ErrorInfo{Code: 30007, Msg: "账号已存在"}
	AdminRoleIdsNotIn            = &ErrorInfo{Code: 30008, Msg: "只能选择自己角色组下面的角色"}
	AdminAddError                = &ErrorInfo{Code: 30009, Msg: "添加管理员角色失败"}
	AdminOperateSelfError        = &ErrorInfo{Code: 30010, Msg: "不能操作自己"}
	AdminOperateSameRoleError    = &ErrorInfo{Code: 30011, Msg: "不能操作相同角色组的用户"}
	AdminOperateOtherRoleError   = &ErrorInfo{Code: 30012, Msg: "不能操作其他角色组的用户"}
	AdminEditOnlySelectYourRole  = &ErrorInfo{Code: 30013, Msg: "只能选择自己角色组下面的角色"}
	AdminRoleEmpty               = &ErrorInfo{Code: 30014, Msg: "角色组名称不能为空"}
	AdminRolePidError            = &ErrorInfo{Code: 30015, Msg: "上级ID错误"}
	AdminRoleExists              = &ErrorInfo{Code: 30016, Msg: "角色名称已存在"}
	AdminDeniedOperateOtherRole  = &ErrorInfo{Code: 30017, Msg: "不能操作不属于当前管理员的角色组"}
	AdminDeniedOperateParentRole = &ErrorInfo{Code: 30018, Msg: "上级角色组ID不能为当前角色组的下级ID"}
	AdminRoleAddResourceIdError  = &ErrorInfo{Code: 30019, Msg: "权限ID不能小于等于0"}
	AdminDeniedOperateSelfRole   = &ErrorInfo{Code: 30020, Msg: "不能操作自己的角色"}
	AdminRoleHasUser             = &ErrorInfo{Code: 30021, Msg: "角色组中有管理员不能操作"}
)
